import Vue from 'vue'
import VueRouter from 'vue-router'

// import Login from '../components/Login.vue'
const Login = () => import(/* webpackChunkName: "login_home" */'../components/Login.vue')
// import Home from '../components/Home.vue'
const Home = () => import(/* webpackChunkName: "login_home" */'../components/Home.vue')
// import Plan from '../components/plan/Plan.vue'
const Plan = () => import(/* webpackChunkName: "plan_pass" */'../components/plan/Plan.vue')
// import Pass from '../components/pass_manager/Pass.vue'
const Pass = () => import(/* webpackChunkName: "plan_pass" */'../components/pass_manager/Pass.vue')

Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: '/home' },
  { path: '/login', component: Login },
  {
    path: '/home',
    component: Home,
    redirect: '/plan',
    children: [
      { path: '/plan', component: Plan },
      { path: '/passManager', component: Pass }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
